//    Copyright (C) Kherty.  All rights reserved.
using System;
using OpenLS.Core.Serialization;
using OpenLS.Vml.Serialization;

namespace OpenLS.Vml
{
    class Curve : ShapeBase
    {
        private string _from;
        private string _control1;
        private string _control2;
        private string _to;

        public override void ReadXml(ReadContext context)
        {
            using (var c = context.Read(VmlConstants.VmlNamespace + "curve"))
            {
                _from = c.GetOptionalString("from");
                _control1 = c.GetOptionalString("control1");
                _control2 = c.GetOptionalString("control2");
                _to = c.GetOptionalString("to");
                ReadXmlContent(c);
            }

        }

        public override void WriteXml(WriteContext context)
        {
            using (var c = context.Write(VmlConstants.VmlNamespace + "curve"))
            {
                c.SetOptionalString("from", _from);
                c.SetOptionalString("control1", _control1);
                c.SetOptionalString("control2", _control2);
                c.SetOptionalString("to", _to);
                WriteXmlContent(c);
            }

        }
    }
}